import Vue from 'vue'
import VueRouter from "vue-router";
Vue.use(VueRouter)

import articleDetail  from '../views/article-detail.vue'
import layout from '../views/layout.vue'
import article from '../views/article.vue'
import collect from '../views/collect.vue'
import like from '../views/like.vue'
import user from '../views/user.vue'

const router = new VueRouter({
  routes: [
    {
      path:'/',
      component:layout,
      children:[
      {
        path:'article',
        component:article
      },
      {
       path:'collect',
       component:collect
      },
      {
        path:'like',
        component:like
       },
       {
        path:'user',
        component:user
       }
    ]
    },
    {
      path:'/detail/:id',
      component:articleDetail
    }
  ],
  mode:'history'
})

export default router